import * as sysMapping from "@/settings/sysMapping"
import axios from "@/settings/axios";

export async function getUserInfo() {


    let userInfo = JSON.parse(localStorage.getItem(sysMapping.USER_INFO));

    if (userInfo !== null && userInfo !== undefined && Object.keys(userInfo).length !== 0) {
        return userInfo;
    }
    userInfo = await axios.get("/SysUser/get_login_user_info");

    localStorage.setItem(sysMapping.USER_INFO, JSON.stringify(userInfo ) );

    return userInfo;
}
// module.exports = { getUserInfo };
